<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
	<meta charset="UTF-8">
	<title><?php if(isset($seo_title) && isset($site_title) && ($seo_title == $site_title)){?><?php echo isset($seo_title)?$seo_title:"";?><?php }else{?><?php echo isset($seo_title)?$seo_title:"";?>-<?php echo isset($site_title)?$site_title:"";?><?php }?></title>
	<meta name="description" content="<?php echo isset($seo_description)?$seo_description:"";?>">
	<meta name="Keywords" content="<?php echo isset($seo_keywords)?$seo_keywords:"";?>">
	<meta http-equiv="X-UA-Compatible" content="IE=Edge">
	<link href="<?php echo urldecode(Url::urlFormat("@static/images/favicon.png"));?>" rel="apple-touch-icon-precomposed">
	<link type="image/x-icon" href="<?php echo urldecode(Url::urlFormat("@favicon.ico"));?>" rel="icon">
	<link type="text/css" rel="stylesheet" href="<?php echo urldecode(Url::urlFormat("#css/common.css"));?>" />
		<!--[if IE 6]>
		<script src="<?php echo urldecode(Url::urlFormat("#js/DD_belatedPNG-min.js"));?>"></script>
		<script>DD_belatedPNG.fix('.ie6png');</script>
		<![endif]-->
		<script type="text/javascript">
			var server_url = '<?php echo urldecode(Url::urlFormat("@"));?>__con__/__act__';
			var Tiny = {user:{name:'<?php echo isset($user['name'])?$user['name']:'';?>',id:'<?php echo isset($user['id'])?$user['id']:0;?>',online:<?php echo isset($user['id']) && $user['id']?'true':'false';?>}};
		</script>
		<?php echo JS::import('jquery');?>
		<script type='text/javascript' src="<?php echo urldecode(Url::urlFormat("#js/common.js"));?>"></script>
		<!--S 一个页面只引入一次即可-->
		<link rel="stylesheet" type="text/css" href="<?php echo urldecode(Url::urlFormat("#js/jslider.css"));?>" />
		<script type='text/javascript' src="<?php echo urldecode(Url::urlFormat("#js/jslider.js"));?>"></script>
		<!--E 只引入一次-->

	</head>
	<body>
		<script type="text/javascript">if(screen.width < 1200) { document.getElementsByTagName('body')[0].className = 'screen_960'; }</script>

		<!--S 头部 -->
		<div id="header" class="clearfix">
			<div class="header-bar">
				<div class="wrap nav">
					<ul class=" fr">
						<?php if($user){?>
						<li>你好<b><?php echo isset($user['name'])?$user['name']:"";?></b> [<a href="<?php echo urldecode(Url::urlFormat("/simple/logout"));?>">安全退出</a>]，<?php echo isset($site_name)?$site_name:"";?>！</li>
						<li><a href="<?php echo urldecode(Url::urlFormat("/ucenter/order"));?>">我的订单</a></li>
						<?php }else{?>
						<li><a href="<?php echo urldecode(Url::urlFormat("/simple/login"));?>"><b>登录</b></a></li>
						<li><a href="<?php echo urldecode(Url::urlFormat("/simple/reg"));?>">注册</a></li>
						<?php }?>
						<li><a href="<?php echo urldecode(Url::urlFormat("/index/help_index"));?>">帮助中心</a></li>
					</ul>
				</div>
			</div>
			<div class="header-main">
				<div class="wrap">
					<div class="logo "><a href="<?php echo urldecode(Url::urlFormat("/index/index"));?>"><img class="ie6png" src="<?php echo urldecode(Url::urlFormat("@$site_logo"));?>" style="max-height:74px;"></a></div>
					<div class="header-search fl">
						<form id="search-form" action="<?php echo urldecode(Url::urlFormat("/"));?>" method="get">
							<input type="hidden" name="con" value="index">
							<input type="hidden" name="act" value="search">
							<input type='hidden' name='tiny_token_' value='<?php echo Tiny::app()->getToken("");?>'/>
							<input id="search-keyword" class="txt-keyword" name="keyword" value="<?php echo isset($keyword)?$keyword:"";?>" type="text"><button type="submit" class="btn-search fl"><b>搜 索</b></button>
						</form>
						<p id="tags-list"><b>热门标签：</b><?php $item=null; $query = new Query("tags");$query->order = "is_hot desc,sort desc,num desc";$query->limit = "6";$items = $query->find(); foreach($items as $key => $item){?><a href="#"><?php echo isset($item['name'])?$item['name']:"";?></a><?php }?></p>
					</div>
					<div class="header-cart">
						<dl class="fr">
							<dt ><i class="icon-member ie6png vm"></i><a class="vm" href="<?php echo urldecode(Url::urlFormat("/ucenter/index"));?>">我的商城</a><s class="b-triangle"></s></dt>
							<dd class="cart-list">
								<?php $sidebar_nav = array('我的订单'=>'order', '我的关注'=>'attention', '商品咨询'=>'consult', '商品评价'=>'review', '我的消息'=>'message', '收货地址'=>'address', '我的优惠券'=>'voucher', '账户金额'=>'account');?>
								<ul>
									<?php foreach($sidebar_nav as $key => $item){?>
									<li><a href="<?php echo urldecode(Url::urlFormat("/ucenter/$item"));?>"><?php echo isset($key)?$key:"";?></a></li>
									<?php }?>
								</ul>
							</dd>
						</dl>
					</div>
				</div>
			</div>
			<div class="header-nav" id="float">
				<div class="wrap">
					<ul class="nav">
						<li><a href="<?php echo urldecode(Url::urlFormat("/index/index"));?>">首页</a></li>
						<?php $item=null; $query = new Query("nav");$query->where = "type = 'main' and enable = 1";$query->order = "`sort` desc";$items = $query->find(); foreach($items as $key => $item){?>
						<li><a href="<?php if(strstr($item['link'],'http://')===false){?><?php echo urldecode(Url::urlFormat("$item[link]"));?><?php }else{?><?php echo isset($item['link'])?$item['link']:"";?><?php }?>" target="<?php if($item['open_type']==1){?>_blank<?php }else{?>_self<?php }?>"><?php echo isset($item['name'])?$item['name']:"";?></a></li>
						<?php }?>
					</ul>
					<div class="category">
						<h3 ><a href="#" ><i class="icon-list ie6png vm"></i>全部商品分类<s class="b-triangle vm"></s></a></h3>
						<div style="height: 410px;" class="group clearfix">
						<?php $current_category_ids='';$parent_category='';?>
							<?php foreach($category as $key => $categ){?>
							<dl>
								<dt>
									<h4><a href="<?php echo urldecode(Url::urlFormat("/index/category/cid/$categ[id]"));?>">
									<?php if(isset($categ['id'])){?>
                                    <?php $current_category_ids=$categ['id'].',';$parent_category=$categ['id'];?>
                                    <?php }?> <?php echo isset($categ['title'])?$categ['title']:"";?></a></h4>
								</dt>
								<dd>
									<ul class="sub">
										<?php foreach($categ['child'] as $key => $child){?>
										<li>
											<h5><a href="<?php echo urldecode(Url::urlFormat("/index/category/cid/$child[id]"));?>">
											<?php if(isset($child['id'])){?>
                                            <?php $current_category_ids.=$child['id'].',';?>
                                            <?php }?>
											<?php echo isset($child['title'])?$child['title']:"";?></a></h5>
											<p>
												<?php if(isset($child['child'])){?>
												<?php foreach($child['child'] as $key => $grandson){?>
												<a href="<?php echo urldecode(Url::urlFormat("/index/category/cid/$grandson[id]"));?>">
												<?php if(isset($grandson['id'])){?>
                                                <?php $current_category_ids.=$grandson['id'].',';?><?php }?>
												<?php echo isset($grandson['title'])?$grandson['title']:"";?></a>
												<?php }?>
												<?php }?>
											</p>
										</li>
										<?php }?>
									</ul>
									<ul class="brand">
                                        <li>推荐品牌</li>
                                        <li>
                                        <?php $current_category_ids = trim($current_category_ids,',');?>
                                        <?php $item=null; $query = new Query("goods as go");$query->fields = "br.name,br.id";$query->join = "left join brand as br on go.brand_id = br.id";$query->where = "go.category_id in($current_category_ids)";$query->group = "go.brand_id";$query->cache = "true";$items = $query->find(); foreach($items as $key => $item){?>
                                        <?php if($item['name']!=''){?>
                                        <span><a href="<?php echo urldecode(Url::urlFormat("/index/category/cid/$parent_category/sort/0/brand/$item[id]"));?>"><?php echo isset($item['name'])?$item['name']:"";?></a></span>
                                        <?php }?>
                                        <?php }?>
                                        </li>
                                    </ul>
								</dd>
							</dl>
							<?php }?>
						</div>
					</div>
				</div>
			</div>
		</div>
		<!--E 头部 -->
		<!--S content-->
		<div id="content">
			<div class="wrap">
				<!--S 产品展示-->
<link type="text/css" rel="stylesheet" href="<?php echo urldecode(Url::urlFormat("#css/product.css"));?>" />
<script type='text/javascript' src="<?php echo urldecode(Url::urlFormat("#js/jquery.enlarge.js"));?>"></script>
<script type="text/javascript">
	//$("body").addClass("screen_960");
</script>
<div class="nav-bar mt5">
    <?php foreach($category_nav as $key => $item){?>
    <?php if($item != end($category_nav)){?>
    <a class="category-<?php echo isset($key)?$key:"";?>" href="<?php echo urldecode(Url::urlFormat("/index/category/cid/$item[id]"));?>"><?php echo isset($item['name'])?$item['name']:"";?> &gt;</a>
    <?php }else{?>
    <span class="category-<?php echo isset($key)?$key:"";?>"><?php echo isset($item['name'])?$item['name']:"";?></span>
    <?php }?>
    <?php }?>
</div>
<div class="goods-detail mt10 clearfix" style="position: relative;">
    <div class="sidebar" style="width:230px;">
        <?php if(isset($category_child['child'])){?>
        <div class="box">
            <?php foreach($category_child['child'] as $key => $child){?>
            <h2><a href="<?php echo urldecode(Url::urlFormat("/index/category/cid/$child[id]"));?>"><?php echo isset($child['title'])?$child['title']:"";?></a></h2>
            <ul class="category-nav">
                <?php foreach($child['child'] as $key => $grandson){?>
                <li><a href="<?php echo urldecode(Url::urlFormat("/index/category/cid/$grandson[id]"));?>"><?php echo isset($grandson['title'])?$grandson['title']:"";?></a></li>
                <?php }?>
            </ul>
            <?php }?>
        </div>
        <?php }?>
        <div class="box mt10">
            <h2>热销排行榜</h2>
            <ul class="content child-category-list ">
                <?php $item=null; $query = new Query("goods as go");$query->join = "left join order_goods as ord on (go.id = ord.goods_id)";$query->fields = "go.*, sum(ord.goods_nums) as sell_num";$query->order = "sell_num desc";$query->group = "go.id";$query->limit = "10";$items = $query->find(); foreach($items as $key => $item){?>
                <li>
                    <dl>
                        <dt class="img tc"><a href="<?php echo urldecode(Url::urlFormat("/index/product/id/$item[id]"));?>"><img src="<?php echo Common::thumb($item['img'],220,220);?>" width=220></a></dt>
                        <dd><a href="<?php echo urldecode(Url::urlFormat("/index/product/id/$item[id]"));?>"><?php echo isset($item['name'])?$item['name']:"";?></a></dd>
                        <dd><span class="price fl">售价：<b class="red"><?php echo isset($currency_symbol)?$currency_symbol:"";?><?php echo isset($item['sell_price'])?$item['sell_price']:"";?></b></span><span class="market_price fr">市场价：<s><?php echo isset($currency_symbol)?$currency_symbol:"";?><?php echo isset($item['market_price'])?$item['market_price']:"";?></s></span></dd>
                    </dl>
                </li>
                <?php }?> 
            </ul>
        </div>
    </div>
    <div class="content">
        <!--S 筛选部分-->
        <div id="selector">
            
            <div class="spec-attr box">
                <h2><span class="red" style="font-size: 14px;"><?php echo isset($current_category['name'])?$current_category['name']:"";?></span> 商品筛选</h2>
                <!--S 品牌-->
                <?php if($has_brand){?>
                <dl class="attr clearfix">
                    <dt class="attr-key">品牌：</dt>
                    <dd class="attr-value">
                        <?php foreach($has_brand as $key => $item){?>
                        <a <?php if(isset($selected['brand']) && $selected['brand']==$item['id']){?> class="select" <?php $url_tem=str_replace("/brand/$item[id]","",$url);?>href="<?php echo urldecode(Url::urlFormat("$url_tem"));?>" <?php }else{?>href="<?php echo urldecode(Url::urlFormat("$url/brand/$item[id]"));?>" <?php }?> ><?php echo isset($item['name'])?$item['name']:"";?>(<?php echo isset($brand_num[$item['id']])?$brand_num[$item['id']]:"";?>)<i></i></a>
                        <?php }?>
                    </dd>
                </dl>
                <?php }?>
                <!--E 品牌-->
                <!--S 价格-->
                <?php if($price_range){?>
                <dl class="attr clearfix">
                    <dt class="attr-key">价格：</dt>
                    <dd class="attr-value">
                        <?php foreach($price_range as $key => $item){?>
                        <a <?php if(isset($selected['price']) && $selected['price']==$item){?> class="select" <?php $url_tem=str_replace("/price/$item","",$url);?>href="<?php echo urldecode(Url::urlFormat("$url_tem"));?>" <?php }else{?>href="<?php echo urldecode(Url::urlFormat("$url/price/$item"));?>" <?php }?> ><?php if(strpos($item,'-')===false){?><?php echo isset($item)?$item:"";?>以上<?php }else{?><?php echo isset($item)?$item:"";?><?php }?><i></i></a>
                        <?php }?>
                    </dd>
                </dl>
                <?php }?>
                <!--E 价格-->
                
                <?php foreach($spec_attr as $key => $item){?>
                <dl class="attr clearfix">
                    <dt class="attr-key"><?php echo isset($item['name'])?$item['name']:"";?>：</dt>
                    <dd class="attr-value">
                        <?php foreach($item['values'] as $key => $value){?>
                        <a <?php if(isset($selected[$item['id']]) && $selected[$item['id']]==$value['id']){?> class="select" <?php $url_tem=str_replace("/$item[id]/$value[id]","",$url);?>href="<?php echo urldecode(Url::urlFormat("$url_tem"));?>" <?php }else{?>href="<?php echo urldecode(Url::urlFormat("$url/$item[id]/$value[id]"));?>" <?php }?> ><?php echo isset($value['name'])?$value['name']:"";?><i></i></a>
                        <?php }?>
                    </dd>
                </dl>
                <?php }?>
            </div>
            <div id="select-more">
                <div class="attr-extra"><div></div></div>
            </div>
        </div>
        <!--E 筛选部分-->
        <!--S 商品部分-->
        <div class="mt10 product_show  clearfix">
            <div class="box " style="margin-left: 12.5px;padding: 4px 0;">
                <div class="sort-bar">
                    <span>排序：</span>
                    <a href="<?php echo urldecode(Url::urlFormat("$url/sort/0"));?>" <?php if($sort==0){?>class="current"<?php }?>>默认<i class="ie6png"></i></a>
                    <a href="<?php echo urldecode(Url::urlFormat("$url/sort/1"));?>" <?php if($sort==1){?>class="current"<?php }?>>销量<i class="ie6png"></i></a>
                    <a href="<?php echo urldecode(Url::urlFormat("$url/sort/2"));?>" <?php if($sort==2){?>class="current"<?php }?>>评论数<i class="ie6png"></i></a>
                    <a <?php if($sort==4){?> href="<?php echo urldecode(Url::urlFormat("$url/sort/3"));?>" class="current-2" <?php }elseif($sort==3){?>href="<?php echo urldecode(Url::urlFormat("$url/sort/4"));?>" class="current"<?php }else{?> href="<?php echo urldecode(Url::urlFormat("$url/sort/4"));?>" <?php }?>>价格<i class="ie6png"></i></a>
                    <a href="<?php echo urldecode(Url::urlFormat("$url/sort/5"));?>" <?php if($sort==5){?>class="current"<?php }?>>最新<i class="ie6png"></i></a>
                </div>
                <div class="page-nav"><b class=" red">共<?php echo isset($goods['page']['total'])?$goods['page']['total']:"";?>个商品</b> <?php echo isset($topPageBar)?$topPageBar:"";?></div>
            </div>
            <dl>
                <dd>
            <ul>
                <?php if(isset($goods['data'])){?>
                <?php foreach($goods['data'] as $key => $item){?>
                <li>
                    <dl class="product">
                        <dt class="img"><a href="<?php echo urldecode(Url::urlFormat("/index/product/id/$item[id]"));?>"><img src="<?php echo Common::thumb($item['img'],220,220);?>" width=220></a></dt>
                        <dd class="title"><a href="<?php echo urldecode(Url::urlFormat("/index/product/id/$item[id]"));?>"><?php echo isset($item['name'])?$item['name']:"";?></a></dd>
                        <dd><span class="price"><?php echo isset($currency_symbol)?$currency_symbol:"";?><?php echo isset($item['sell_price'])?$item['sell_price']:"";?></span><del class="market_price"><?php echo isset($currency_symbol)?$currency_symbol:"";?><?php echo isset($item['market_price'])?$item['market_price']:"";?></del></dd>
                    </dl>
                </li>
                <?php }?>
                <?php }?>             
            </ul>
        </dd>
        </dl>
        </div>
        <div class="page-nav"><?php echo isset($goods['html'])?$goods['html']:"";?></div>
        <!--E 商品部分-->
    </div>
</div>
<script>
    var attr_extra = '';
    $(".attr").each(function(i){
        var self = $(this);
        if(i>3){
            //self.css("display","none");
           // attr_extra += self.find(".attr-key:eq(0)").text()+"、";
        }
        if(self.find(".attr-value").get(0).scrollHeight>self.height()){
            var span = $("<div class='o-more'>更多<b></b></div>");
            self.append(span);
            if(self.find('.select').size()>0){
                span.html('收起<b></b>');
                span.parent().addClass("unflod");
            }
            span.on("click",function(){
                if($(this).text()=='更多'){
                    $(this).html('收起<b></b>');
                    $(this).parent().addClass("unflod");
                }
                else {
                    $(this).html('更多<b></b>');
                    $(this).parent().removeClass("unflod");
                }
            });
        }
    });

    attr_extra = $(".attr:gt(3) .attr-key").text();
    attr_extra = $.trim(attr_extra);
    attr_extra = attr_extra.replace(/：/gi,'、');
    attr_extra = attr_extra.replace(/、$/gi,'');
    if($(".attr:gt(3)").size()>0){
        
        if($(".attr:gt(3)").find(".select").size()>0){
            $(".attr:gt(3)").css("display","block");
            $(".attr-extra div:eq(0)").html('收起<b></b>');
            $(".attr-extra").addClass("unflod");
        }else{
            $(".attr:gt(3)").css("display","none");
            $(".attr-extra div:eq(0)").html('更多选项（'+attr_extra+'）<b></b>');
            $(".attr-extra").removeClass("unflod");
        }
    }else{
        $("#select-more").css("display","none");
    }
    $(".attr-extra:eq(0)").on("click",function(){
        if($(".attr:hidden").size()>0){
            $(".attr:gt(3)").css("display","block");
            $(".attr-extra div:eq(0)").html('收起<b></b>');
            $(".attr-extra").addClass("unflod");
        }else{
            $(".attr:gt(3)").css("display","none");
            $(".attr-extra div:eq(0)").html('更多选项（'+attr_extra+'）<b></b>');
            $(".attr-extra").removeClass("unflod");
        }
        
    })

</script>
			</div>
		</div>
		<!--E content-->
		<!--S 底部 -->
		<div id="footer" class="mt20  ">
			<div class="wrap">
				<div class="footer-main clearfix">
					<?php $item=null; $query = new Query("help_category");$query->order = "sort desc";$query->limit = "5";$items = $query->find(); foreach($items as $key => $item){?>
					<dl >
						<dt class="clearfix"><span class="icon-<?php echo isset($item['alias'])?$item['alias']:"";?> fl"></span><a href="javascript:;"><?php echo isset($item['name'])?$item['name']:"";?></a></dt>
						<?php $help=null; $query = new Query("help");$query->where = "category_id = $item[id]";$query->item = "$help";$query->cache = "true";$query->cacheTime = "1200";$items = $query->find(); foreach($items as $key => $help){?>
						<dd><a href="<?php echo urldecode(Url::urlFormat("/index/help/id/$help[id]"));?>"><?php echo isset($help['title'])?$help['title']:"";?></a></dd>
						<?php }?>
					</dl>
					<?php }?>
				</div>
				<div class="footer-links">
					<p><a><b>友情连接：</b></a><a href="http://www.tinyrise.com">济南泰创软件科技有限公司</a></p>
				</div>
				<div class="copyright">
					<div><?php $item=null; $query = new Query("nav");$query->where = "type = 'bottom'";$query->order = "`sort` desc";$items = $query->find(); foreach($items as $key => $item){?>
					<a href="<?php if(strstr($item['link'],'http://')===false){?><?php echo urldecode(Url::urlFormat("$item[link]"));?><?php }else{?><?php echo isset($item['link'])?$item['link']:"";?><?php }?>" target="<?php if($item['open_type']==1){?>_blank<?php }else{?>_self<?php }?>"><?php echo isset($item['name'])?$item['name']:"";?></a>
					<?php }?></div>
					<!--S 济南泰创软件科技有限公司保留所有版权，非授权用户严禁删除版权信息；擅自删除，后果自负，您的支持是我们成长的动力。-->
					<div><span>Powered by <a href="http://www.tinyrise.com"><b style="color: #7c0000">Tiny</b><b style="color: #666">Shop</b></a></span> © 2014 <a href="http://www.tinyrise.com">tinyrise.com</a> . 保留所有权利 。<?php echo isset($site_icp)?$site_icp:"";?> </div>
					<!--S 济南泰创软件科技有限公司保留所有版权，非授权用户严禁删除版权信息；擅自删除，后果自负，您的支持是我们成长的动力。-->
				</div>
			</div>

		</div>
		<!--S 购物车 -->
		<div id="shopping-cart" >

			<div id="card-wrap" class="ie6png">
				<div class="clearfix" style="height: 32px;"><a href="<?php echo urldecode(Url::urlFormat("/simple/cart"));?>" class="fr btn btn-gray" style="padding: 2px 6px;font-size: 12px;" target="_blank">查看购物车</a></div>
				<div id="card-list">
					<?php $total=0.00;?>
					<?php foreach($cart as $key => $item){?>
					<?php $total += $item['amount'];?>
					<div class="card-item" id="<?php echo isset($item['id'])?$item['id']:"";?>">
						<div class="pic">
							<a class="card-pic" href="<?php echo urldecode(Url::urlFormat("/index/product/id/$item[goods_id]"));?>" target="_blank" title="<?php echo isset($item['name'])?$item['name']:"";?>"><img src="<?php echo urldecode(Url::urlFormat("@$item[img]"));?>" width="50" height="50"></a></div>
							<div class="spec">
								<?php foreach($item['spec'] as $key => $spec){?>
								<p title="<?php echo isset($spec['name'])?$spec['name']:"";?>:<?php echo isset($spec['value'][2])?$spec['value'][2]:"";?>"><?php echo isset($spec['value'][2])?$spec['value'][2]:"";?></p>
								<?php }?>
							</div>
							<div class="num"><?php echo isset($item['num'])?$item['num']:"";?></div>
							<div class="price" title="<?php echo isset($item['amount'])?$item['amount']:"";?>"><?php echo isset($item['amount'])?$item['amount']:"";?></div>
							<a class="icon-close ie6png" productid="<?php echo isset($item['id'])?$item['id']:"";?>"></a>
						</div>
						<?php }?>
					</div>
				</div>
				<div id="shopping-bar-box" >
					<div id="shopping-bar">
						<div class="fl tl" style="padding-left:8px;" > <i class="icon-cart ie6png" style="zoom:1;"></i><span style="zoom:1;">购物车(<b class="cart-product-num"><?php echo count($cart);?></b>)</span></div> 
						<span class="fr tr">
							<div style="padding-right:12px;"><span class="currency-symbol"><?php echo isset($currency_symbol)?$currency_symbol:"";?></span><b class="cart-total"><?php echo  sprintf("%01.2f",$total);?></b></div>
						</span>
					</div>
					<a id="settlement" href="<?php echo urldecode(Url::urlFormat("/simple/cart"));?>">去结算</a>
				</div>
			</div>
			<script type="text/javascript">
				$("#shopping-cart").on("mouseenter",function(){
					if($("#card-wrap").position().top>-15)$("#card-wrap").animate({top:"-15px"},100);
				});
				$("#shopping-cart").on("mouseleave",function(){
					if($("#card-wrap").position().top==-15)$("#card-wrap").animate({top:"-5px"},"fast");
				});
				$(document).on("click",function(e){
					$("#card-wrap").animate({top:"-5px"},"fast");
				})
				$("#shopping-cart").on("click",function(e){
					if (e.stopPropagation) {e.stopPropagation();}     
					e.cancelBubble = true;
				});
				$("#shopping-bar").on("click",function(e){
			//for(i in e)alert(i+'==='+e[i]);
			var currentNode = e.currentTarget;
			//alert(currentNode.id);
			//if (e.stopPropagation) {e.stopPropagation();}     
			//e.cancelBubble = true;
			if($("#card-wrap").outerHeight()>360)$("#card-wrap").css("height","360px");
			if($("#card-wrap").position().top>=-15)$("#card-wrap").animate({top:1-$("#card-wrap").outerHeight()},"fast");
			else{
				$("#card-wrap").animate({top:"-5px"},100);
			}
			return false;
		});

				function updateCart(data){
					var card_items = '';
					for(var i in data){
						var spec = data[i]['spec'];
						var spec_str = '';
						for(var k in spec){
							spec_str +="<p>"+spec[k]['value'][2]+"</p>";
						}
						card_items += '<div class="card-item" id="'+i+'"><div class="pic"><img src="<?php echo urldecode(Url::urlFormat("@"));?>'+data[i]['img']+'" width="50" height="50"></div><div class="spec">'+spec_str+'</div><div class="num">'+data[i]['num']+'</div><div class="price">'+(data[i]['amount'])+'</div><a class="icon-close ie6png" productid="'+data[i]['id']+'"></a></div>';
					}
					$("#card-list").empty().append(card_items);
					changeCartInfo();
					bindDelEvent();
				}
				bindDelEvent();
				function bindDelEvent(){
					$("#shopping-cart .icon-close").on("click",function(){
						var btn_close = $(this);
						$.post("<?php echo urldecode(Url::urlFormat("/index/cart_del"));?>",{id:btn_close.attr("productid")},function(){
							btn_close.parent().remove();
							changeCartInfo();
							$("#card-wrap").css({top:1-$("#card-wrap").outerHeight()},"fast");
						},"json");
					});
				}

				function changeCartInfo(){
					$(".cart-product-num").text($(".card-item").size());
					var total = 0.00;
					$(".card-item .price").each(function(){
						total += parseFloat($(this).text());
					});
					$(".cart-total").text(total.toFixed(2));
				}
				$("#tags-list a").each(function(){
					$(this).on("click",function(){
						$("#search-keyword").val($(this).text());
						$("#search-form").submit();
					})
				})
        //导航高亮
        $(".header-nav .nav li").has("a[href='<?php echo isset($url_index)?$url_index:"";?>']").addClass("current");
        //
        $(".header-cart dl,.category,.category .group dl").hover(
        	function () {
        		$(this).addClass("hover");
        	},
        	function () {
        		$(this).removeClass("hover");
        	}
        	);
        </script>
        <!--E 购物车 -->
        <!--E 底部 -->
    </body>
    </html>
<!--Powered by TinyRise-->